use std::fs;
use std::path::PathBuf;
fn traverse_dir(dir_path: &str) -> std::io::Result<()> {
  let dir = fs::read_dir(dir_path)?;
  for entry in dir {
    let entry = entry?;
    let path = entry.path();
    if path.is_file() {
      println!("File name:{:?}", path.file_name().unwrap());
    } else if path.is_dir() {
      traverse_dir(&path.to_string_lossy());
    }
  }
  Ok(())
}
fn main() -> std::io::Result<()> {
  let dir_path = "/home/timly/Desktop/gitworkspace/rust_stream_media_m3u8/demo3_read_file/vedios";
  traverse_dir(dir_path)?;
  Ok(())
}
